package com.bdqn.service;

import com.bdqn.mapper.AuthorityMapper;
import com.bdqn.pojo.Authority;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AuthorityServiceImpl implements AuthorityService{
    @Resource
    AuthorityMapper authorityMapper;

    /**
     * 权限信息搜索查询
     * @param roleId
     * @return
     */
    @Override
    public List<Authority> findListByRoleId(Long roleId) {
        return authorityMapper.findListByRoleId(roleId);
    }

    /**
     * 权限插入操作
     * @param authority
     * @return
     */
    @Override
    public int add(Authority authority) {
        return authorityMapper.add(authority);
    }

    /**
     * 删除权限信息
     * @param roleId
     * @return
     */
    @Override
    public int deleteByRoleId(Long roleId) {
        return authorityMapper.deleteByRoleId(roleId);
    }
}
